package pack0619;
/*
    2. 打印图形
               *
           *   *   *
       *   *   *   *  *
  *                       *
       *             *
          *      *
              *
 */

public class DemoB {
    public static void main(String[] args) {
        for (int i = 0; i < 4; i++) {
            //先打空格
            for (int j = 0; j < 3 - i; j++) {
                System.out.print(" ");
            }
            //打*
            for (int k = 0; k < 2 * i + 1; k++) {
                if (k == 0 || k == 2 * i) {
                    System.out.print("*");
                } else {
                    System.out.print(" ");
                }
                //换行
                System.out.println();
            }
            //下半三角形
            for ( i = 0; i < 3; i++) {
                //先打空格
                for (int j = 0; j <= i; j++) {
                    System.out.print(" ");
                }
                //打*
                for (int k = 0; k < 5 - 2 * i; k++) {
                    if (k == 0 || k == 5 - 2 * i - 1) {
                        System.out.print("*");
                    } else {
                        System.out.print(" ");
                    }

                }
                //换行
                System.out.println();

            }


        }


    }
}
